package mapper;

import model.Course;
import model.Teacher;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface TeacherCourseMapper {
    //查询每个老师有多少课程

    @Select("select c.* from course c,tbl_teachercourse  tc where tc.teacher_id=#{teacher_id} and c.id=tc.course_id")
    List<Course> selectByTeacherId (int teacher_id);
    //查询每个课程有多少老师
    @Select("select t.* from teacher t,tbl_teachercourse  tc where tc.course_id=#{courese_id} and t.id=tc.teacher_id")
    List<Teacher> selectByCourseId(int course_id);
}
